package Day12;

import java.util.ArrayList;
import java.util.List;

public class NewTest {
    public static void main(String[] args) {
        NewTitle car=new NewTitle(1,"汽车","管理员");
        NewTitle gaokao=new NewTitle(2,"高考","管理员");
        List newsTitleList=new ArrayList();
        newsTitleList.add(car);
        newsTitleList.add(gaokao);
        System.out.println("新闻标题数目为:"+newsTitleList.size()+"条");
        for (int i=0;i<newsTitleList.size();i++){
            NewTitle title=(NewTitle)newsTitleList.get(i);
            System.out.println(i+1+":"+title.getTitleName());
        }
    }

}
